package com.example.mq.server;

import com.example.mq.common.MqException;
import com.example.mq.server.messagemanager.Message;
import com.example.mq.server.virtualhost.ExchangeType;
import com.example.mq.server.virtualhost.MQueue;

import java.io.IOException;

public interface ServerAPI {
    boolean exchangeDeclare(String exchangeName, ExchangeType exchangeType);
    boolean exchangeDelete(String exchangeName);
    boolean queueDeclare(String queueName);
    boolean queueDelete(String queueName);
    boolean bind(String queueName, String exchangeName, String bindingKey);
    boolean unbind(String queueName, String exchangeName);
    boolean produceMessage (String exchangeName, String routingKey, byte[] body);
    boolean processSubscribe(String consumerTag, String queueName);
    void consumeMessage(String ConsumerTag, Message message, MQueue queue) throws MqException, IOException, ClassNotFoundException;
}
